home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / jbcomm12.zip / COMMTEST.PAS next >
Pascal/Delphi Source File  |  1988-03-16  |  2KB  |  67 lines

  1. program commtest;
  2.  
  3. uses crt,jbcomm;
  4.  
  5. var ch        : char;
  6.     i         : integer;
  7.         info      : com_info_rec;
  8.  
  9. begin
  10.   c_port_info(com1,info);
  11.     write('The port is ');
  12.     if info.active then
  13.         writeln('Active.')
  14.     else
  15.         writeln('not Active.');
  16.     write('The interrupts are ');
  17.     if info.ints_on then
  18.         writeln('Active.')
  19.     else
  20.         writeln('not Active.');
  21.   writeln('Speed  = ',info.speed);
  22.     write('Parity = ');
  23.   case info.parity of
  24.         p_none:writeln('NONE');
  25.         p_even:writeln('EVEN');
  26.         p_odd :writeln('ODD ');
  27.         p_even_stick:writeln('EVEN w/STICK');
  28.         p_odd_stick:writeln('ODD w/STICK')
  29.     end;
  30.     writeln('Data = ',info.data);
  31.     writeln('Stops= ',info.stops);
  32.   writeln('Hit CR to exit. ');
  33.   c_open(com1,2400,p_none,8,1,4096,256);
  34.     ch:=#0;
  35.     repeat
  36.         if keypressed then
  37.         begin
  38.             ch:=readkey;
  39.             if ch<>#27 then c_putc(com1,ch)
  40.         end;
  41.         if c_inready(com1)>0 then write(c_getc(com1))
  42.     until ch=#27;
  43.     c_close(com1,true);
  44.   c_port_info(com1,info);
  45.     write('The port is ');
  46.     if info.active then
  47.         writeln('Active.')
  48.     else
  49.         writeln('not Active.');
  50.     write('The interrupts are ');
  51.     if info.ints_on then
  52.         writeln('Active.')
  53.     else
  54.         writeln('not Active.');
  55.   writeln('Speed  = ',info.speed);
  56.     write('Parity = ');
  57.   case info.parity of
  58.         p_none:writeln('NONE');
  59.         p_even:writeln('EVEN');
  60.         p_odd :writeln('ODD ');
  61.         p_even_stick:writeln('EVEN w/STICK');
  62.         p_odd_stick:writeln('ODD w/STICK')
  63.     end;
  64.     writeln('Data = ',info.data);
  65.     writeln('Stops= ',info.stops);
  66.   writeln('Hit CR to exit. ')
  67. end.